#pragma once
#include "TubeTruckTypes.h"
#include <vector>
#include <string>
#include "serialization.h"

template<typename... Args> class serializer;

template<typename A, typename... Args> 
class serializer<const A&, Args...> {
public:

   template<typename... VArgs>
   static inline void run(std::vector<byte>& vec, const A& a, const VArgs&... ags) {
      serialize<A>(vec, a);
      serializer<Args...>::run(vec, ags...);
   }

};

template<typename A, typename... Args> 
class serializer<A, Args...> {
public:

   template<typename... VArgs>
   static inline void run(std::vector<byte>& vec, const A& a, const VArgs&... ags) {
      serialize<A>(vec, a);
      serializer<Args...>::run(vec, ags...);
   }

};

template<> 
class serializer<> {
public:
   static inline void run(std::vector<byte>& vec) { }
};

